﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;

namespace ReusableControls.Controls
{
    public class ColoredTextBox : TextBox
    {
        public ColoredTextBox()
            : base()
        {
            this.TextChanged += ColoredTextBox_TextChanged;
            this.DefaultStyleKey = typeof(TextBox);
        }

        void ColoredTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (this.Text.Length == 0)
                this.Background = new SolidColorBrush(Colors.Pink);
            else
                this.Background = new SolidColorBrush(Colors.White);
        }
    }
}
